<template>
    <div>
      <el-table
        :data="tableData"
        border
      >
        <el-table-column
          align="center"
          prop="create_time"
          label="时间"
        />
        <el-table-column
          align="center"
          prop="buy_num"
          label="条数"
        />
        <el-table-column
          align="center"
          prop="pay_amount"
          label="金额（元）"
        />
        <el-table-column
          align="center"
          prop="buy_type_name"
          label="类型"
        />
        <el-table-column
          align="center"
          prop="username"
          label="操作人"
        />
      </el-table>
      <custom-page
        ref="customPage"
        :total="total"
        @getList="getList"
      ></custom-page>
    </div>
  </template>
  
  <script>
  import { buyLog } from "@/api/marketing"
  import customPage from "@/components/customPage";
  export default {
    components: { customPage },
    data() {
      return {
        tableData: [],
        total: 0
      }
    },
    methods: {
      getList() {
        const { page, pageSize } = this.$refs.customPage;
        buyLog({
          page,
          pageSize,
          service_type: 2
        }).then(res => {
          const { data, total } = res;
          this.tableData = data || [];
          this.total = total || 0;
        })
      }
    },
    mounted() {
      this.getList();
    }
  }
  </script>
  
  <style lang="scss" scoped>
  </style>
  